import functools
import time
def printcalltime(fun):
    @functools.wraps(fun)
    def wrapper(*args,**kw):
        start = time.time()
        # 调用函数
        res = fun(*args,**kw)
        end = time.time()
        print("%s excuted time = %d ms !" % (fun.__name__, (end-start) * 1000))
        return res
    # 回调装饰函数
    return wrapper
@printcalltime
# 被装饰函数
def print1():
    # 休眠
    time.sleep(2)
    print(1)
print1()
print(print1.__name__)
